using System;
using System.ComponentModel.DataAnnotations;

namespace ERP.Domain.Warehouse.Allocation
{
	/// <summary>
	/// 库存（仓库+货位+商品 粒度），用于调拨时读取与锁定
	/// </summary>
	public class Inventory
	{
		[Key]
		public int Id { get; set; }

		public int WarehouseId { get; set; }
		public int LocationId { get; set; }
		public int ProductId { get; set; }

		/// <summary>
		/// 现存量
		/// </summary>
		public decimal Quantity { get; set; }

		/// <summary>
		/// 锁定量（占用）
		/// </summary>
		public decimal LockedQty { get; set; }

		/// <summary>
		/// 移动加权单价
		/// </summary>
		public decimal AvgPrice { get; set; }

		public DateTime UpdatedAt { get; set; } = DateTime.Now;
	}
}

